package com.schoolinfo.dao;

import java.util.List;

import com.schoolinfo.model.Goods;

public interface GoodsDAO {

	public abstract void save(Goods transientInstance);

	public abstract void delete(Goods persistentInstance);

	public abstract Goods findById(java.lang.Integer id);

	public abstract List<Goods> findByExample(Goods instance);

	public abstract List findByProperty(String propertyName, Object value);

	public abstract List<Goods> findByName(Object name);

	public abstract List<Goods> findByType(Object type);

	public abstract List<Goods> findByState(Object state);

	public abstract List<Goods> findByPic(Object pic);

	public abstract List<Goods> findByContactName(Object contactName);

	public abstract List<Goods> findByPlace(Object place);

	public abstract List<Goods> findByHot(Object hot);

	public abstract List<Goods> findByDescribe(Object describe);

	public abstract List findAll();

	public abstract Goods merge(Goods detachedInstance);

	public abstract void attachDirty(Goods instance);

	public abstract void attachClean(Goods instance);
	
	
	public abstract List findHotList(int n);
	
	public List findBySecondId(int id);
	
	/**
	 * 按时间顺序查找从start开始长度为length的记录
	 * @param type 0：全部；1：卖 ； 2：买
	 * @param start
	 * @param length
	 * @return
	 */
	public List findAllScope(String type,int start,int length);
	
	public List findByTitle(String title,int start,int length);
	
	public int findByTitleCount(String title);
	public List findByUserId(String userId);
	public List findByUserId(String userId,int start,int offset);
	
	public void update(Goods instance);
}